package com.hbx.residential_service.domain;

import com.hbx.residential_service.utils.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class House {
    private int houseId;
    private String houseNum;
    private int houseBuild;
    private Integer houseStatus;
    private String houseStatusStr;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date houseDate;
    private String houseDateStr;
    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getHouseId() {
        return houseId;
    }

    public void setHouseId(int houseId) {
        this.houseId = houseId;
    }

    public String getHouseNum() {
        return houseNum;
    }

    public void setHouseNum(String houseNum) {
        this.houseNum = houseNum;
    }

    public int getHouseBuild() {
        return houseBuild;
    }

    public void setHouseBuild(int houseBuild) {
        this.houseBuild = houseBuild;
    }

    public Integer getHouseStatus() {
        return houseStatus;
    }

    public void setHouseStatus(Integer houseStatus) {
        this.houseStatus = houseStatus;
    }

    public String getHouseStatusStr() {
        if(houseStatus!=null){
            if(houseStatus==0)houseStatusStr="未入住";
            if(houseStatus==1)houseStatusStr="已入住";
        }
        return houseStatusStr;
    }

    public void setHouseStatusStr(String houseStatusStr) {
        this.houseStatusStr = houseStatusStr;
    }

    public Date getHouseDate() {
        return houseDate;
    }

    public void setHouseDate(Date houseDate) {
        this.houseDate = houseDate;
    }

    public String getHouseDateStr() {
        if(houseDate!=null){
            houseDateStr= DateUtils.DateToString(houseDate,"yyyy-MM-dd");
        }
        return houseDateStr;
    }

    public void setHouseDateStr(String houseDateStr) {
        this.houseDateStr = houseDateStr;
    }
}
